// Write a program in Java to demonstrate use of this keyword.
// Check whether this can access the private members of the class or not. with real world example
class Student {
    private String name;
    private int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void displayInfo() {
        System.out.println("Name: " + this.name);
        System.out.println("Age: " + this.age);
    }

    public boolean isSameStudent(Student otherStudent) {
        return this.name.equals(otherStudent.name) && this.age == otherStudent.age;
    }
}

public class ThisKeywordExample {
    public static void main(String[] args) {
        Student student1 = new Student("Dibos Saha", 20);
        Student student2 = new Student("Nahid Military", 22);

        student1.displayInfo();
        System.out.println("-----------------");
        student2.displayInfo();

        System.out.println("-----------------");

        if (student1.isSameStudent(student2)) {
            System.out.println("Both students are the same.");
        } else {
            System.out.println("Students are different.");
        }
    }
}
